<html>
<head><meta charset="utf-8"><title>how to enable debug-assertions for rustdoc · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20enable.20debug-assertions.20for.20rustdoc.html">how to enable debug-assertions for rustdoc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184239967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20enable%20debug-assertions%20for%20rustdoc/near/184239967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yunhua <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20enable.20debug-assertions.20for.20rustdoc.html#184239967">(Dec 26 2019 at 02:30)</a>:</h4>
<p>following rustc-guide instruction, I've built rustdoc tool with the command:  "./x.py build --stage 1 src/libstd src/tools/rustdoc --keep-stage 1". <br>
in the source code, there are some debug print like debug!(...).  but <br>
RUST_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc <a href="http://test.rs" target="_blank" title="http://test.rs">test.rs</a><br>
I couldn't get any debug!(...) output. <br>
I've added  debug = true and debug-assertions = true in </p>
<ol>
<li>$rustc_source/config.toml</li>
<li>$rustc_source/Cargo.toml <br>
[profile.release]<br>
debug = true<br>
debug-assertions = true</li>
</ol>
<p>[profile.dev]<br>
debug = true<br>
debug-assertions = true</p>
<p>[profile.test]<br>
debug = true<br>
debug-assertions = true</p>
<p>I also tried add those to src/tools/rustdoc/Cargo.toml<br>
[profile.dev]<br>
debug = true<br>
debug-assertions = true</p>
<p>Got warning like this.<br>
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:<br>
package:   $rustc_source/src/tools/rustdoc/Cargo.toml<br>
workspace: $rustc_source/Cargo.toml</p>
<p>Still couldn't get debug!() output with command:<br>
RUST_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc <a href="http://test.rs" target="_blank" title="http://test.rs">test.rs</a></p>
<p>Any idea? Thanks!</p>



<a name="184242870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20enable%20debug-assertions%20for%20rustdoc/near/184242870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yunhua <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20enable.20debug-assertions.20for.20rustdoc.html#184242870">(Dec 26 2019 at 04:13)</a>:</h4>
<p>OH, it should be RUSTDOC_LOG=debug. this is the right command. <br>
RUSTDOC_LOG=debug ./build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc <a href="http://test.rs" target="_blank" title="http://test.rs">test.rs</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>